/**
 * @Author       : xinbaiyu
 * @Version      : V1.0
 * @Date         : 2025-03-13 10:03:46
 * @Description  : 
*/
// acceptArr = ['png', 'jpg']
import {
    cloneDeep
} from "lodash";
export default function (acceptArr: string[], name: string): boolean {
    acceptArr = cloneDeep(acceptArr).map(str => str.toLocaleLowerCase().replace('.', ''))
    if (name.split(".").length <= 1) {
        return true;
    } else {
        let type = name
            .split(".")[name.split(".").length - 1].toLocaleLowerCase();
        if (acceptArr.includes(type)) {
            return true;
        }
    }
    return false;
}